#!/bin/sh

uci -q batch <<-EOF >/dev/null
	delete firewall.luci_app_pptp_server
	set firewall.luci_app_pptp_server=include
	set firewall.luci_app_pptp_server.type=script
	set firewall.luci_app_pptp_server.path=/var/etc/pptpd.include
	set firewall.luci_app_pptp_server.reload=1
EOF

uci -q batch <<-EOF >/dev/null
	delete ucitrack.@luci-app-pptp-server[-1]
	add ucitrack luci-app-pptp-server
	set ucitrack.@luci-app-pptp-server[-1].init=luci-app-pptp-server
	commit ucitrack
EOF

/etc/init.d/pptpd disable 2>/dev/null
/etc/init.d/pptpd stop 2>/dev/null
rm -rf /tmp/luci-*cache
exit 0
